/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nc.solutions.rentacar.manager.Impl;

import com.nc.solutions.rentacar.domain.order.IOrder;
import com.nc.solutions.rentacar.domain.order.impl.Order;
import com.nc.solutions.rentacar.manager.IOrderManager;
import java.util.TreeMap;

/**
 *
 * @author Andrey
 */
public class OrderManager implements IOrderManager{

	TreeMap<Integer,IOrder> tmpOrder = new TreeMap<Integer,IOrder>();
	static int k=0;
	@Override
	public IOrder newOrder() {
		Order order = new Order(++k);
		return order;
	}

	@Override
	public IOrder getOrder(int id) {
		return tmpOrder.get(id);
	}

	@Override
	public boolean delOrder(int id) {
		return tmpOrder.remove(id) == null;
	}
}
